<template>
<div>
    <view :class="active" @click="topClick">
        <slot></slot>
    </view>
</div>
</template>

<script>
export default {
    name: 'BackTop',
    data() {
        return {

        }
    },
    methods: {
        topClick() {
			uni.pageScrollTo({
			    scrollTop: 0,
			    duration: 300
			});
        }
    },
    props: {
        active: {
            type: String,
            default: 'back-top'
        }
    }
}
</script>

<style>
.back-top {
    position: fixed;
    right: 10upx;
    bottom: 100upx;
}

.back-top_home {
    position: fixed;
    right: 10upx;
    bottom: 100upx;
}
.back-top_home_wx {
    position: fixed;
    right: 10upx;
    bottom: 10upx;
}
</style>